package Stefan 
{
	import adobe.utils.CustomActions;
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author Stefan Hristov
	 */
	
	public class Player extends Sprite
	{
		public var hor_speed:Number;
		public var ver_speed:Number;
		
		
		public function Player(x:Number = 0, y:Number = 0 ) 
		{
			graphics.beginFill(0x0000FF);
			graphics.drawRect(x, y, 25, 25);
			graphics.endFill();
			addEventListener(Event.ENTER_FRAME, onTick);
		}
		
		
		private function onTick(e:Event):void
		{
			trace("onTick");
		}
		
		
		public function MoveLeft(amount:Number = 1):void
		{
			x += amount;
			if (x + stage.width >= stage.stageWidth)
				x = stage.stageWidth - stage.width;
				
		}
		
		
		public function MoveRight(amount:Number = 1):void
		{
			x -= amount;
			if (x <= 0)
			{
				x = 0;
			}
		}
	}

}